package com.tgy.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/***
 * @ClassName: Redirect
 * @Description: 学习重定向
 * @Auther: 送一一块二向箔
 * @Date: 21:37 2021/12/4
 * @version : V1.0
 */
public class Redirect extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        /**
         resp.setHeader("Location","/r2/img");
         resp.setStatus(302);
         */
        resp.sendRedirect("/Servlet_02_war/Download");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
